package ccmis.finance.account.action;
import javax.ejb.EJB;
import jfox.platform.infrastructure.SuperAction;
import ccmis.finance.account.bo.SubjectListBo;
import ccmis.finance.account.entity.SubjectList;
import jfox.platform.common.PaginationList;
import org.jfox.framework.annotation.Service;
import org.jfox.mvc.ActionContext;
import org.jfox.mvc.Invocation;
import org.jfox.mvc.PageContext;
import org.jfox.mvc.annotation.ActionMethod;
@Service(id = "subjectlist")
public class SubjectListAction extends SuperAction{
	@EJB 
	SubjectListBo subjectListBo;
	@ActionMethod(name="index", successView = "ccmis/finance/subjectList/list_subject_list.vhtml", invocationClass = SubjectListInvocation.class)
	public void indexPage(ActionContext actionContext) throws Exception{
		
	 }
	@ActionMethod(name="select", successView = "include/json_response.vhtml", invocationClass = SubjectListInvocation.class)
	public void select(ActionContext actionContext) throws Exception{
		SubjectListInvocation invocation = (SubjectListInvocation)actionContext.getInvocation();
		int start = invocation.getStart();
        int limit = invocation.getLimit();
		PaginationList<SubjectList> subjectlist = subjectListBo.getAllSubjectList(start,limit);
	    PageContext pageContext = actionContext.getPageContext();
	    
	    pageContext.setAttribute(JSON_RESPONSE_OBJ, subjectlist);
	    System.out.print("ssd__________"+subjectlist+"dd");
	 }
	public static class SubjectListInvocation extends Invocation {
		// ss
        private int start = 0;
        private int limit = 25;
		public int getStart() {
			return start;
		}
		public void setStart(int start) {
			this.start = start;
		}
		public int getLimit() {
			return limit;
		}
		public void setLimit(int limit) {
			this.limit = limit;
		}
	}
}
